{Compute} az vm resize: Migrate commands to aaz#32618
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the az vm resize command from the legacy mgmt.compute SDK to the AAZ (Azure API Auto-generation) framework, modernizing the implementation while maintaining backward compatibility with the existing behavior.
Key changes:
- Refactored
resize_vmfunction to use AAZ-based VMUpdate and VMShow operations - Added logic to detect and skip redundant resize operations when VM is already the target size
- Included a new integration test that validates the resize functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Migrated resize_vm function from mgmt.compute to AAZ framework, implementing pre_instance_update and post_operations hooks |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Added VMResizeScenarioTest with test_vm_resize_changes_size to validate resize functionality |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_resize_changes_size.yaml | Generated test recording for the resize test scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
az vm resize: Migrate commands to aaz
cfcab69 to
da211a5
Compare
dev dev fix: re run test recording dev dev
da211a5 to
c691c86
Compare
| 'no_wait': no_wait, | ||
| 'hardware_profile': {'vm_size': size}, | ||
| } | ||
| return VMUpdate(cli_ctx=cmd.cli_ctx)(command_args=command_args) |
There was a problem hiding this comment.
We could consider using the VMCreate class instead, as it only sends a PUT request and avoids an additional GET request.
Related command
az vm resizeDescription
Migration from mgmt.compute to aaz-based
Testing Guide
History Notes
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.